import { window, Range, Position } from 'vscode'

export const insertText = (val: string) => {
  const editor = window.activeTextEditor
  if (!editor) {
    return
  }
  const { selection } = editor
  const range = new Range(selection.end, selection.end)

  editor.edit((editorBuilder) => editorBuilder.replace(range, `\n${val}`))
}
